import request from "@/utils/request";

export function create(data) {
  return request({
    url: "api/v1/ExperimentTemplateRecord/Create",
    method: "post",
    timeout: 1000000,
    data,
  });
}

export function deleteRecord(data) {
  return request({
    url: "api/v1/ExperimentTemplateRecord/Delete",
    method: "delete",
    data,
  });
}

export function update(data) {
  return request({
    url: "api/v1/ExperimentTemplateRecord/Update",
    method: "post",
    timeout: 1000000,
    data,
  });
}

export function updateTemplate(data) {
  return request({
    url: "api/v1/ExperimentTemplateRecord/UpdateTemplateContent",
    method: "post",
    data,
  });
}

export function getSingleList(data) {
  return request({
    url: "api/v1/ExperimentTemplateRecord/Get",
    method: "get",
    timeout: 1000000,
    params: data,
  });
}

export function getList(data, pagination) {
  if (pagination) {
    data["pageIndex"] = pagination.pageIndex;
    data["pageSize"] = pagination.pageSize;
  }
  return request({
    url: "api/v1/ExperimentTemplateRecord/GetList",
    method: "get",
    params: data,
  });
}
export function getStandBookList(data, pagination) {
  if (pagination) {
    data["pageIndex"] = pagination.pageIndex;
    data["pageSize"] = pagination.pageSize;
  }
  return request({
    url: "api/v1/ExperimentTemplateRecord/GetStandBookList",
    method: "get",
    params: data,
  });
}

export function verify(data) {
  return request({
    url: "api/v1/ExperimentTemplateRecord/Verify",
    method: "post",
    data: data,
  });
}

export function invalid(data) {
  return request({
    url: "api/v1/ExperimentTemplateRecord/Invalid",
    method: "post",
    data: data,
  });
}

export function getAuditLog(data) {
  return request({
    url: "api/v1/ExperimentTemplateRecord/GetAuditLog",
    method: "get",
    params: data,
  });
}

export function Getlasthuditlogbylatald(data) {
  return request({
    url: "api/v1/WorkFlowAuditLog/GetLastAuditLogByDataId",
    method: "get",
    params: data,
  });
}
